package question3;

import java.util.Scanner;

public class Test {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        GoodsList goodsList = new GoodsList();
        goodsList.showMenu();
        System.out.print("请选择你要购买商品的编号：");
        int choose = input.nextInt();
        while (choose > 5 || choose < 1){
            System.out.print("没有此商品编号请重新输入！");
            choose = input.nextInt();
        }
        System.out.print("请输入你购买的数量：");
        int amount = input.nextInt();
        String str = goodsList.buyGoods(choose,amount);
        System.out.print("你需要支付："+str+"元");
    }
}
